package com.wpl.service.impl;

import com.wpl.bean.User;
import com.wpl.bean.UserExample;
import com.wpl.dao.UserMapper;
import com.wpl.service.IOnlineService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 在线人员
 */
@Service
public class OnlineServiceImpl implements IOnlineService {
    @Resource
    private UserMapper userMapper;

    /**
     * 在线人员
     * @return
     */
    @Override
    public List<User> getUsers() {
        UserExample userExample = new UserExample();
        UserExample.Criteria criteria = userExample.createCriteria();
        criteria.andOnlineEqualTo(1);
        return userMapper.selectByExample(userExample);
    }
}
